# -*- encoding=utf8 -*-
__author__ = "Admin"

from airtest.core.api import *
from airtest.cli.parser import cli_setup

if not cli_setup():
    auto_setup(__file__, logdir=True, devices=["Android:///",])

from poco.drivers.android.uiautomation import AndroidUiautomationPoco
poco = AndroidUiautomationPoco(use_airtest_input=True, screenshot_each_action=False)

# script content
print("start...")


poco("com.kkpodcast:id/create_clip_iv").click()
poco("com.kkpodcast:id/content_et").click()
text("蹦迪")
poco("com.kkpodcast:id/confirm_tv").click()
poco("com.kkpodcast:id/edit_clip_iv").click()
poco("com.kkpodcast:id/swipe").child("android.widget.LinearLayout").offspring("com.kkpodcast:id/recycler_view").child("android.view.ViewGroup")[1].child("com.kkpodcast:id/edit_iv").click()
text("纯音乐")
poco("com.kkpodcast:id/confirm_tv").click()
poco("com.kkpodcast:id/back_iv").click()

# generate html reports
from airtest.report.report import simple_report
# 设置自定义报告目录
custom_log_dir = r"E:\Work\codings\python\2506project\airtest\reports"

# 确保目录存在
if not os.path.exists(custom_log_dir):
    os.makedirs(custom_log_dir)
# generate html reports
simple_report(__file__, logpath=True, output=os.path.join(custom_log_dir, "liushengpoco.html"))










